package com.ruoyi.quartz.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.YongyouCgrkMapper;
import com.ruoyi.quartz.domain.YongyouCgrk;
import com.ruoyi.quartz.service.IYongyouCgrkService;

/**
 * 采购入库Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-17
 */
@Service
public class YongyouCgrkServiceImpl implements IYongyouCgrkService 
{
    @Autowired
    private YongyouCgrkMapper yongyouCgrkMapper;

    /**
     * 查询采购入库
     * 
     * @param vouchdate 采购入库主键
     * @return 采购入库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public YongyouCgrk selectYongyouCgrkByVouchdate(String vouchdate)
    {
        return yongyouCgrkMapper.selectYongyouCgrkByVouchdate(vouchdate);
    }

    /**
     * 查询采购入库列表
     * 
     * @param yongyouCgrk 采购入库
     * @return 采购入库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<YongyouCgrk> selectYongyouCgrkList(YongyouCgrk yongyouCgrk)
    {
        return yongyouCgrkMapper.selectYongyouCgrkList(yongyouCgrk);
    }

    /**
     * 新增采购入库
     * 
     * @param yongyouCgrk 采购入库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertYongyouCgrk(YongyouCgrk yongyouCgrk)
    {
        return yongyouCgrkMapper.insertYongyouCgrk(yongyouCgrk);
    }

    /**
     * 修改采购入库
     * 
     * @param yongyouCgrk 采购入库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateYongyouCgrk(YongyouCgrk yongyouCgrk)
    {
        return yongyouCgrkMapper.updateYongyouCgrk(yongyouCgrk);
    }

    /**
     * 批量删除采购入库
     * 
     * @param vouchdates 需要删除的采购入库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouCgrkByVouchdates(String[] vouchdates)
    {
        return yongyouCgrkMapper.deleteYongyouCgrkByVouchdates(vouchdates);
    }

    /**
     * 删除采购入库信息
     * 
     * @param vouchdate 采购入库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouCgrkByVouchdate(String vouchdate)
    {
        return yongyouCgrkMapper.deleteYongyouCgrkByVouchdate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouCgrkByDate(String vouchdate)
    {
        return yongyouCgrkMapper.deleteYongyouCgrkByDate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int clearCgrk()
    {
        return yongyouCgrkMapper.clearCgrk();
    }
}
